package org.onepiece.admin.common.utils;

import com.google.common.collect.Lists;

import java.util.ArrayList;

/**
 * Created by IntelliJ IDEA.
 *
 * @author zhujianke@gaodun.com
 * @since 2022/8/31 16:35
 */
public class Test {

    public static void main(String[] args) {
        // stash save
//        Worker worker = Worker.builder()
//                .id(1)
//                .salary(1d)
//                .build();
//
//        Worker worker2 = Worker.builder()
//                .id(2)
//                .salary(2d)
//                .build();
//
//        List<Worker> workers = Lists.newArrayList(worker, worker2);
//
//        Map<Integer, Double> salaryMap = workers.stream()
//                .collect(Collectors.groupingBy(Worker::getId, Collectors.collectingAndThen(
//                        Collectors.mapping(Worker::getSalary, Collectors.reducing(Double::sum)), Optional::get)));




//        for (int m = 1; m < 101; m++) {
//
//            System.out.println(m + "条数据怎么分：");
//
//            List<Integer> aList = Lists.newArrayList();
//            double aProbability = 0.8;
//            List<Integer> bList = Lists.newArrayList();
//            double bProbability = 0.2;
//            for (int i = 1; i <= m; i++) {
//                int totalSize = aList.size() + bList.size();
//                if (totalSize > 0) {
//                    if (aList.size() > 0) {
//                        aProbability = 0.8 - (double) aList.size() / (totalSize + 1);
//                    }
//                    if (bList.size() > 0) {
//                        bProbability = 0.2 - (double) bList.size() / (totalSize + 1);
//                    }
//                }
//
//                if (aProbability >= bProbability) {
//                    aList.add(i);
//                } else {
//                    bList.add(i);
//                }
//            }
//
//            System.out.println(aList);
//            System.out.println(bList);
//
//            System.out.println("===========");
//            System.out.println();
//        }


//        ArrayList<Integer> integers = Lists.newArrayList(1, 2, 3, 4, 5, 6);
//        integers.stream().filter(item -> item != 3).forEach(System.out::println);

        int i = 1 << 16;
        System.out.println(i);
    }
}
